home *** CD-ROM | disk | FTP | other *** search
- Path: news.lpr.carel.fi!usenet
- From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
- Newsgroups: comp.lang.c++
- Subject: Re: GetSystemMetrics
- Date: Thu, 25 Jan 1996 12:00:24 +0200
- Organization: Carelcomp Forest
- Message-ID: <310754B8.596A@cmt.lpr.mail.carel.fi>
- References: <4e71gu$ja@kirin.wwa.com>
- NNTP-Posting-Host: renoir.cclahti.carel.fi
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b6a (WinNT; I)
-
- Theo Bals wrote:
- >
- > Hi there fellow C programmers
- >
- > I am (trying to) use the function 'GetSyetemMetrics' to find out the
- > size of a window.
- > The documentation supplied with the Microsoft Visual V1.5 complier
- > seems to indicate i should use GetsystemMetrics(SM_SXSCREEN) for the
- > width and GetSystemMetrics(SM_CYSCREEN) for the height of the window.
- > But it looks like these functions always return the values as if the
- > window was maximized. I have solved my particular problem by
- > 'intercepting' the WM_SIZE message from windows which gives me the size
- > of the resized window in lParam but i am wondering if i am doing the
- > right thing here.
- > As anyone had any problems with this also?
- >
- > Theo.
-
- Actually, GetSystemMetrics returns information about the _system_, not a single
- window. The values you're referring to return the width and the height of the
- _screen_, not a window. If you know the window handle, you can
-
- RECT rect;
-
- GetWindowRect(hWnd, &rect);
-
- which will give you the rectangle of the window, or
-
- GetClientRect(hWnd, &rect);
-
- which will give you the rectangle of the client area of the window.
-
- BTW, this kind of questions should be targeted to Windows programming
- newsgroups (such as comp.os.ms-windows.programmer.misc), since they do not deal
- with C++.
-
- Later,
- AriL
-
- --
- All my opinions are mine and mine alone.
-